<html>
<head>
  <meta charset="utf-8">
  <title>Blockly Block Factory</title>
  <script type="text/javascript" src="../../blockly_compressed.js"></script>
  <script type="text/javascript" src="../../language/en/_messages.js"></script>
  <script type="text/javascript" src="blocks.js"></script>
  <style>
    html, body {
      background-color: #fff;
      margin: 0;
      padding:0;
      overflow: hidden;
    }
    .blocklySvg {
      height: 100%;
      width: 100%;
    }
  </style>
  <script>
    function init() {
      var toolbox = document.getElementById('toolbox');
      Blockly.inject(document.body, {path: '../../', toolbox: toolbox});

      if (window.parent.initEditor) {
        // Let the top-level application know that Blockly is ready.
        window.parent.initEditor(Blockly);
      } else {
        // Attempt to diagnose the problem.
        var msg = 'Error: Unable to communicate between frames.\n\n';
        if (window.parent == window) {
          msg += 'Try loading index.html instead of frame.html';
        } else if (window.location.protocol == 'file:') {
          msg += 'This may be due to a security restriction preventing\n' +
              'access when using the file:// protocol.\n' +
              'http://code.google.com/p/chromium/issues/detail?id=47416';
        }
        alert(msg);
      }
    }
  </script>
</head>
<body onload="init()">
  <xml id="toolbox" style="display: none">
    <category name="Input">
      <block type="input_value"></block>
      <block type="input_statement"></block>
      <block type="input_dummy"></block>
    </category>
    <category name="Title">
      <block type="title_static"></block>
      <block type="title_input"></block>
      <block type="title_dropdown"></block>
      <block type="title_checkbox"></block>
      <block type="title_colour"></block>
      <block type="title_variable"></block>
      <block type="title_image"></block>
    </category>
    <category name="Type">
      <block type="type_group"></block>
      <block type="type_null"></block>
      <block type="type_boolean"></block>
      <block type="type_number"></block>
      <block type="type_string"></block>
      <block type="type_list"></block>
      <block type="type_other"></block>
    </category>
    <category name="Colour" id="colourCategory">
      <block type="colour_hue"><title name="HUE">65</title></block>
      <block type="colour_hue"><title name="HUE">120</title></block>
      <block type="colour_hue"><title name="HUE">160</title></block>
      <block type="colour_hue"><title name="HUE">210</title></block>
      <block type="colour_hue"><title name="HUE">230</title></block>
      <block type="colour_hue"><title name="HUE">290</title></block>
      <block type="colour_hue"><title name="HUE">330</title></block>
    </category>
  </xml>
</body>
</html>
